import request from '@/utils/request'

// 卡密管理API
const cardSecretApi = {

  // 创建卡密
  createCardSecret(data) {
    return request({
      url: '/machine/code/create',
      method: 'post',
      data
    })
  },

  // 获取卡密列表
  getCardSecretList(query) {
    return request({
      url: '/machine/code/list',
      method: 'get',
      params: query
    })
  },

  // 立即失效卡密
  expire(id) {
    return request({
      url: `/machine/code/expire`,
      method: 'get',
      params: {id:id}
    })
  },

  // 删除卡密
  deleteCardSecret(id) {
    return request({
      url: `/tenant/cardSecret/${id}`,
      method: 'delete'
    })
  },

  //修改秘钥

  editCardSecret(data) {
    return request({
      url: '/machine/code/update',
      method: 'post',
      data
    })
  },

}

export default cardSecretApi